.class public Lcom/adview/adapters/MomarkAdapter;
.super Lcom/adview/adapters/AdViewAdapter;
.source "MomarkAdapter.java"

# interfaces
.implements Lcom/donson/momark/util/AdViewListener;


# instance fields
.field adView:Lcom/donson/momark/view/view/AdView;


# direct methods
.method public constructor <init>(Lcom/adview/AdViewLayout;Lcom/adview/obj/Ration;)V
    .locals 3
    .parameter "adViewLayout"
    .parameter "ration"

    .prologue
    .line 28
    invoke-direct {p0, p1, p2}, Lcom/adview/adapters/AdViewAdapter;-><init>(Lcom/adview/AdViewLayout;Lcom/adview/obj/Ration;)V

    .line 29
    new-instance v0, Ljava/lang/String;

    iget-object v2, p2, Lcom/adview/obj/Ration;->key:Ljava/lang/String;

    invoke-direct {v0, v2}, Ljava/lang/String;-><init>(Ljava/lang/String;)V

    .line 30
    .local v0, key:Ljava/lang/String;
    new-instance v1, Ljava/lang/String;

    iget-object v2, p2, Lcom/adview/obj/Ration;->key2:Ljava/lang/String;

    invoke-direct {v1, v2}, Ljava/lang/String;-><init>(Ljava/lang/String;)V

    .line 32
    .local v1, key2:Ljava/lang/String;
    invoke-static {v1, v0}, Lcom/donson/momark/AdManager;->init(Ljava/lang/String;Ljava/lang/String;)V

    .line 33
    const/4 v2, 0x0

    iput-object v2, p0, Lcom/adview/adapters/MomarkAdapter;->adView:Lcom/donson/momark/view/view/AdView;

    .line 34
    return-void
.end method


# virtual methods
.method public handle()V
    .locals 4

    .prologue
    .line 40
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v2

    sget-object v3, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v2, v3, :cond_0

    .line 41
    const-string v2, "AdView SDK v1.7.0"

    const-string v3, "Into Momark"

    invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 42
    :cond_0
    iget-object v2, p0, Lcom/adview/adapters/MomarkAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v2}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/adview/AdViewLayout;

    .line 43
    .local v1, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v1, :cond_2

    .line 57
    :cond_1
    :goto_0
    return-void

    .line 49
    :cond_2
    iget-object v2, v1, Lcom/adview/AdViewLayout;->activityReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v2}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/Activity;

    .line 50
    .local v0, activity:Landroid/app/Activity;
    if-eqz v0, :cond_1

    .line 55
    new-instance v2, Lcom/donson/momark/view/view/AdView;

    const-string v3, "adview"

    invoke-direct {v2, v0, v3}, Lcom/donson/momark/view/view/AdView;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    iput-object v2, p0, Lcom/adview/adapters/MomarkAdapter;->adView:Lcom/donson/momark/view/view/AdView;

    .line 56
    iget-object v2, p0, Lcom/adview/adapters/MomarkAdapter;->adView:Lcom/donson/momark/view/view/AdView;

    invoke-virtual {v2, p0}, Lcom/donson/momark/view/view/AdView;->setAdViewListener(Lcom/donson/momark/util/AdViewListener;)V

    goto :goto_0
.end method

.method public onAdViewSwitchedAd(Lcom/donson/momark/view/view/AdView;)V
    .locals 3
    .parameter "paramAdView"

    .prologue
    .line 81
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_0

    .line 82
    const-string v1, "AdView SDK v1.7.0"

    const-string v2, "Momark success"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 84
    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcom/donson/momark/view/view/AdView;->setAdViewListener(Lcom/donson/momark/util/AdViewListener;)V

    .line 86
    iget-object v1, p0, Lcom/adview/adapters/MomarkAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adview/AdViewLayout;

    .line 87
    .local v0, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v0, :cond_1

    .line 95
    :goto_0
    return-void

    .line 91
    :cond_1
    iget-object v1, v0, Lcom/adview/AdViewLayout;->adViewManager:Lcom/adview/AdViewManager;

    invoke-virtual {v1}, Lcom/adview/AdViewManager;->resetRollover()V

    .line 92
    iget-object v1, v0, Lcom/adview/AdViewLayout;->handler:Landroid/os/Handler;

    new-instance v2, Lcom/adview/AdViewLayout$ViewAdRunnable;

    invoke-direct {v2, v0, p1}, Lcom/adview/AdViewLayout$ViewAdRunnable;-><init>(Lcom/adview/AdViewLayout;Landroid/view/ViewGroup;)V

    invoke-virtual {v1, v2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 93
    invoke-virtual {v0}, Lcom/adview/AdViewLayout;->rotateThreadedDelayed()V

    goto :goto_0
.end method

.method public onConnectFailed(Lcom/donson/momark/view/view/AdView;)V
    .locals 3
    .parameter "paramAdView"

    .prologue
    .line 63
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_0

    .line 64
    const-string v1, "AdView SDK v1.7.0"

    const-string v2, "Momark failure"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 66
    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcom/donson/momark/view/view/AdView;->setAdViewListener(Lcom/donson/momark/util/AdViewListener;)V

    .line 68
    iget-object v1, p0, Lcom/adview/adapters/MomarkAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adview/AdViewLayout;

    .line 69
    .local v0, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v0, :cond_1

    .line 75
    :goto_0
    return-void

    .line 72
    :cond_1
    iget-object v1, v0, Lcom/adview/AdViewLayout;->adViewManager:Lcom/adview/AdViewManager;

    invoke-virtual {v1}, Lcom/adview/AdViewManager;->resetRollover_pri()V

    .line 73
    invoke-virtual {v0}, Lcom/adview/AdViewLayout;->rotateThreadedPri()V

    goto :goto_0
.end method
